package Tests;

import java.lang.reflect.*;  

public class Ref02_Constructor1 {  
  
    public Ref02_Constructor1() { }  
    
    protected void constructor1(int i, double d) { }  
    
    public static void main(String args[]) {  
        try {  
            Class cls = Class.forName("constructor1");  
            Constructor ctorlist[] = cls.getDeclaredConstructors();  
  
            for (int i = 0; i < ctorlist.length; i++) {  
                Constructor ct = ctorlist[i];  
                System.out.println("nome = " + ct.getName());  
                System.out.println("membro da classe = " + ct.getDeclaringClass());  
          
                Class pvec[] = ct.getParameterTypes();  
                for (int j = 0; j < pvec.length; j++)  
                    System.out.println("parâmetro #" + j + " " + pvec[j]);  
  
                Class evec[] = ct.getExceptionTypes();  
                for (int j = 0; j < evec.length; j++)  
                    System.out.println("exceção #" + j + " " + evec[j]);  
            }  
        }  
        catch (Throwable e) {  
            System.err.println(e);  
        }  
    }  
}  